home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5423 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What's your compiler's answer?
  5. Date: Fri, 09 Feb 96 02:04:57 GMT
  6. Organization: none
  7. Message-ID: <823831497snz@genesis.demon.co.uk>
  8. References: <1996Feb7.140945.28351@cs.rit.edu> <4fao4h$dn8@beach.and.nl>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4fao4h$dn8@beach.and.nl> jos@and.nl "Jos A. Horsmeier" writes:
  15.  
  16. >|                i = i-- - --i * ( i = -3 ) * i++ + ++i;
  17.  
  18. ...
  19.  
  20. >No seriously, you shouldn't present this example at all, because the
  21. >behavior of that expression is undefined. One single object 'i' is
  22. >altered more than once between two sequence points, so anything can
  23. >happen. And this 'anything' doesn't happen because of a lack of 
  24. >complete determination of operator precedence ...
  25.  
  26. Yes, it is important to stress that this expression doesn't even have to
  27. generate a result. However the examples collected by this request could
  28. be useful evidence to hammer it into people's head that they shouldn't
  29. write things like this.
  30.  
  31. The expression does generate an impressive number of different results
  32. on different compilers! :-)
  33.  
  34. -- 
  35. -----------------------------------------
  36. Lawrence Kirby | fred@genesis.demon.co.uk
  37. Wilts, England | 70734.126@compuserve.com
  38. -----------------------------------------
  39.